package com.jswdwsx.esign.cloud

import com.jswdwsx.esign.cloud.config.Configuration
import com.jswdwsx.esign.cloud.request.MerchantInfoReq
import com.jswdwsx.esign.cloud.request.SignReq
import com.jswdwsx.esign.cloud.response.FlowStatusResp
import com.jswdwsx.esign.cloud.response.WebResult
import org.springframework.cloud.openfeign.FeignClient
import org.springframework.web.bind.annotation.*


@FeignClient(name = "cloud-basic-esign", configuration = [Configuration::class])
@RequestMapping("esign/v1/api/signs")
interface EsignService {

    @PostMapping
    fun create(@RequestBody signReq: SignReq): WebResult<String?>

    @GetMapping
    fun signQuery(@RequestParam("appId") appId: String, @RequestParam("appSerialNumber") appSerialNumber: String): WebResult<FlowStatusResp>

    @PostMapping("merchant")
    fun initOrg(@RequestBody merchantInfoReq: MerchantInfoReq): WebResult<String?>
}